<?php

$name = trim($_POST["yourname"]);
$email = trim($_POST["email"]);
$message = trim($_POST["message"]);

$sendmessage = "ok";

if($name == null || $name == "" || $email == null || $email == "" || $message == null || $message == "") 
{
	$sendmessage = "error";
}

$body = "E-mail: " .$_POST["email"] ."\n";
$body .= "\n" ."Name: " .$_POST["yourname"] ."\n";
$body .= "\n" ."Website: " .$_POST["website"] ."\n";
$body .= "\n" . $_POST["message"];

$header = "from:".$_POST["myemail"] ."\r\n" ."reply-to:" .$_POST["email"] ."\r\n";

mail($_POST["myemail"], "Tanco Group - Website Contact", $body, $header);

header("Location: contact.php?sendmessage=" .$sendmessage); 
?>